<%@ page import="org.springframework.web.context.request.SessionScope" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%request.setAttribute("ctx", request.getContextPath());%>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui-v2.9.14/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui-v2.9.14/jquery-2.1.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/layui-v2.9.14/layui.js"></script>
    <script src="${pageContext.request.contextPath}/layui-v2.9.14/layui_ext/xmSelect/xm-select.js"></script>
    <script src="${pageContext.request.contextPath}/layui-v2.9.14/crypto-js.js"></script>
    <title>订单详情</title>
</head>
<body>
<h3>报修信息</h3>
工单单号：${order.id}<br>
工单分类：${order.statusTypeName}<br>
报修小区：${order.communityName}${order.content}<br>
报修时间：${order.submitterTime}<br>
报修人：${order.submitter}<br>
手机号：${order.submitterPhone}<br>
工单内容：${order.title}<br>
<c:forEach items="${order.images.split(',')}" var="url">
    <img src="${url}" style="width: 100px; height: 100px"><br>
</c:forEach>
<h3>报修施工进度</h3>
<hr>
<c:forEach items="${orderDetailList}" var="detail">
${detail.worker}--${detail.createTime}<br>
    处理内容：${detail.content}
    <c:forEach items="${detail.images.split(',')}" var="url">
        <img src="${url}" style="width: 100px;" height="100px">
    </c:forEach>
    <br>
    处理时间:${detail.createTime}<br>
</c:forEach>
<div style="display: ${order.statusType==3?'':'none'}">
<h3>评价</h3>
<hr>
<c:forEach items="${rateList}" var="rate">
${rate.username}-${rate.createTime}<br>
    评价内容：${rate.content}<br>
    <hr>
</c:forEach>
<div style="display: ${order.statusType==3?'':'none'}">
    评价:<input type="text" name="content" id="content">
    <button type="button" onclick="pj()">提交评价</button>
</div>
<script>
<%--    评价--%>
function pj(){
    $.post("/order/rate.do",{'orderId':${order.id},'content':$("#content").val()},function (res){
        if(res.code===0){
            alert('评价成功');
        //    刷新当前页面
            location.reload();
        }else{
            alert('评价失败')
        }
    })
}
</script>

</body>
</html>